<script setup>
import { artGetChannelsService } from '@/api/article.js'
import {ref,onMounted} from 'vue'
defineProps({
    modelValue:{
        type:[Number,String]
    }
})
const emit=defineEmits(['update:modelValue'])
const channellist =ref([])
onMounted(async () =>{
    const res = await artGetChannelsService()
    channellist.value=res.data.data
})
</script>
<template>
    <!-- v-model=modelvalue -->
    <el-select :modelValue="modelValue" @update:modelValue="emit('update:modelValue',$event)">
        <el-option v-for="channel in channellist" :key="channel.id" :label="channel.cate_name" :value="channel.id"></el-option>
    </el-select>
</template>